package com.seezoon.domain.service.user.vo;

import com.seezoon.infrastructure.exception.Assertion;
import lombok.Getter;

/**
 * 验证码
 */
@Getter
public class CaptchaVO {

    public static final String TYPE_USER_REGISTER = "user_register";
    public static final String TYPE_USER_LOGIN = "user_login";
    public static final String TYPE_USER_RESET_PASSWORD = "user_reset_password";
    /**
     * 验证码ID
     */
    private final String captchaId;
    /**
     * 验证码文本
     */
    private final String captchaText;
    /**
     * base64 格式表示的图形验证码
     */
    private final String captchaImage;
    /**
     * 验证码JWT
     */
    private final String captchaToken;

    public CaptchaVO(String captchaId, String captchaText, String captchaImage, String captchaToken) {
        Assertion.notEmpty(captchaId, "captchaId is empty");
        Assertion.notEmpty(captchaText, "captchaText is empty");
        Assertion.notEmpty(captchaImage, "captchaImage is empty");
        Assertion.notEmpty(captchaToken, "captchaToken is empty");
        this.captchaId = captchaId;
        this.captchaText = captchaText;
        this.captchaImage = captchaImage;
        this.captchaToken = captchaToken;
    }
}
